package com.ltf.entity;

/**
 * User类代表系统中的用户实体
 * 它封装了用户的属性信息，如ID、账号、密码、角色等
 */
public class User {
    // 用户ID
    private int id;
    // 用户账号
    private String account;
    // 用户密码
    private String password;
    // 用户角色
    private String role;
    // 用户电话号码
    private String phone;
    // 用户昵称
    private String nickname;
    // 用户VIP等级
    private int vip;
    // 用户地址
    private String addr;
    // 用户头像URL
    private String img;
    // 用户账户状态（是否被封号）
    private int closed;

    /**
     * 无参构造函数，用于创建User对象
     */
    public User() {
        System.out.println("User...无参构造...");
    }

    // getter和setter方法，用于获取和设置User类的属性值

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public int getVip() {
        return vip;
    }

    public void setVip(int vip) {
        this.vip = vip;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public int getClosed() {
        return closed;
    }

    public void setClosed(int closed) {
        this.closed = closed;
    }

    /**
     * 重写toString方法，提供User对象的字符串表示
     * 主要用于调试和日志记录
     * @return 包含User对象属性信息的字符串
     */
    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", account='" + account + '\'' +
                ", password='" + password + '\'' +
                ", role='" + role + '\'' +
                ", phone='" + phone + '\'' +
                ", nickname='" + nickname + '\'' +
                ", vip=" + vip +
                ", addr='" + addr + '\'' +
                ", img='" + img + '\'' +
                ", closed=" + closed +
                '}';
    }
}
